import { isDev, getRequest, postRequest } from '@/api';

const urlsObj = {};
if (isDev) {
  // 取得采购申请
  urlsObj.getPurchasePlan = getRequest('purplan');
  urlsObj.getPlanDetail = getRequest('plandetail');
  urlsObj.deletePlan = getRequest('deleteplan');
  urlsObj.savePlan = getRequest('saveplan');
  urlsObj.submitPlan = getRequest('submitplan');
  urlsObj.backPlan = getRequest('backplan');
  urlsObj.getPushPlans = getRequest('pushplans');
  urlsObj.pushPlan = getRequest('pushplan');
  // 取得订单列表
  urlsObj.getPurchaseOrder = getRequest('purorder');
  urlsObj.getOrderDetail = getRequest('orderdetail');
  urlsObj.deleteOrder = getRequest('deleteorder');
  urlsObj.saveOrder = getRequest('saveorder');
  urlsObj.submitOrder = getRequest('submitorder');
  urlsObj.placeOrder = getRequest('placeorder');
  urlsObj.stateOrder = getRequest('stateorder');
  urlsObj.backOrder = getRequest('backorder');
  urlsObj.yetOrder = getRequest('backorder');
} else {
  // 取得采购申请
  urlsObj.getPurchasePlan = postRequest('procurementplan/list');
  urlsObj.getPlanDetail = getRequest('procurementplan/detail/{id}');
  urlsObj.deletePlan = getRequest('procurementplan/delete/{id}');
  urlsObj.savePlan = postRequest('procurementplan/save');
  urlsObj.submitPlan = getRequest('procurementplan/submit/{id}');
  urlsObj.backPlan = getRequest('procurementplan/verb/{id}');
  urlsObj.getPushPlans = postRequest('procurementplan/pushList');
  urlsObj.pushPlan = postRequest('procurementplan/pushProcurementOrder');
  // 取得订单列表
  urlsObj.getPurchaseOrder = postRequest('procurementorder/list');
  urlsObj.getOrderDetail = getRequest('procurementorder/detail/{id}');
  urlsObj.deleteOrder = getRequest('procurementorder/delete/{id}');
  urlsObj.saveOrder = postRequest('procurementorder/save');
  urlsObj.submitOrder = getRequest('procurementorder/submit/{id}');
  urlsObj.backOrder = getRequest('procurementorder/verb/{id}');
  urlsObj.yetOrder = getRequest('procurementorder/purchased/{id}');
  urlsObj.placeOrder = postRequest('procurementorder/order');
  urlsObj.stateOrder = postRequest('procurementorder/finishOrder');
}

export default urlsObj;
